const pageConf = {
    extends: extendsQ,
    data() {
        return {
            // 检测报告列表
            reportTableData: [],
            // 报告类别下拉列表
            reportOptions: [
                { label: "常规报告", value: 1 },
                // { label: "品种建议报告", value: 2 }
            ],
            // 报告类别选中值
            reportVal: [],
            // 检测报告分页
            reportPagination: {
                currentPage: "1",
                pageSizes: [20, 40, 60],
                pageSize: "20",
                total: 0
            },
            // 表格加载动画
            tableLoading: false,
            // 报告详情弹框显示隐藏
            reportDialogVisible: false,
            // 报告详情弹框数据
            reportDialogData: {}
        }
    },
    methods: {
        /**
         * 获取检测报告列表
         */
        getReportTableData() {
            this.tableLoading = true
            let params = {"page":this.reportPagination.currentPage,"size":this.reportPagination.pageSize,"status":5}
            tpHttp.post(this, "action=com.top.riceInstitute.QualityRiceEvaluateInfo.search", { param: JSON.stringify(params) }, (data, code, message) => {
                if (code == 0 && data?.list?.length) {
                    this.reportTableData = data.list;
                    this.reportPagination.total = Number(data.total) || 0;
                } else {
                    this.reportTableData = []
                }
                this.tableLoading = false
            })
        },
        /**
         * 列表查看点击 | 获取详情
         * @param { * } itme 当行数据
         */
        lookUpClick(item) {
            let params = { "id": item.id }
            tpHttp.post(this, "action=com.top.riceInstitute.QualityRiceEvaluateInfo.getReportInfo", { param: JSON.stringify(params) }, (data, code, message) => {
                if (code == 0 && data && JSON.stringify(data) != "{}") {
                    this.reportDialogData = data;
                    this.reportDialogVisible = true;
                } else {
                    this.reportDialogData = {};
                    this.$message.error("暂时无法查看，请稍后重试！")
                }
            })
            
        },
        
        /**
         * 检测报告分页每页条数切换
         * @param { Number } val 
         */
        reportSizeChange(val) {
            this.reportPagination.pageSize = val;
            this.getReportTableData();
        },
        /**
         * 检测报告分页页数切换
         * @param { Number } val 
         */
        reportCurrentChange(val) {
            this.reportPagination.currentPage = val;
            this.getReportTableData();
        },
    },
    mounted() {
        // 获取检测报告列表
        this.getReportTableData();
    }
}